const BASE_URL = 'http://47.97.87.83:8080';
export let VUE_APP_BASE_URL='http://47.97.87.83:8080';

export const myrequest = (Options)=>{
	return new Promise((resolve,reject)=>{
		uni.showLoading({
			title: '加载中',
			mask: true
		})
		uni.request({
			url:BASE_URL + Options.url,
			method:Options.method,
			data:Options.data,
			header:{
				'Content-Type':'application/x-www-form-urlencoded',
			},
			success:(res)=> {
				resolve(res)
				uni.hideLoading()
			},
			fail:(err)=> {
				uni.showToast({
					title:"请求失败",
					icon:'error',
					duration:1000
				})
				reject(err)
				uni.hideLoading()
			},
		})
	})
}